package com.cloudminga.gui;


import com.globussoft.xml.SettingsXml;
import java.awt.Dimension;
import java.awt.Toolkit;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Gui_4.java
 *
 * Created on Dec 17, 2009, 12:19:47 PM
 */

/**
 *
 * @author jyoti
 */
public class Config_4_testresult extends javax.swing.JDialog {

    /** Creates new form Gui_4 */
    Config_3_backup configBackup;
    private String projectName="";
    public Config_4_testresult(java.awt.Frame parent, boolean modal,Config_3_backup configBackup) {
        super(parent, modal);
        initComponents();
        projectName=SettingsXml.getProjectName();
         Dimension dimension = new Dimension(600, 500);
         this.configBackup=configBackup;
        initComponents();
        this.setTitle("Welcome to "+projectName+" Backup Wizard Configuration");
        setSize(600, 500);
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        int x = (toolkit.getScreenSize().width - getWidth()) / 2;
        int y = (toolkit.getScreenSize().height - getHeight()) / 2;
        setResizable(true);
        setLocation(x, y);
        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
       
        String s="<html>"+
                "<body>"+
                "<font size=2.5 color=blue>"+
                "Test Result "+
                "<br>"+
                "&nbsp You have comleted the bandwidth test."+
                "</font>"+
                "</body>"+
                "</html>";
        label_result.setText(s);

         try {
            /* code to set the look and feel according to the native operating system */

            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
            SwingUtilities.updateComponentTreeUI(this);

        } catch (Exception e) {
            System.out.println("Problem in setting look and feel");
        }
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        backResultButton = new javax.swing.JButton();
        cancelResultButton = new javax.swing.JButton();
        nextResultButton = new javax.swing.JButton();
        jLabel2 = new javax.swing.JLabel();
        label_image = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        label_Logo = new javax.swing.JLabel();
        label_result = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("");
        setResizable(false);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        backResultButton.setText("Back");
        backResultButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                backResultButtonActionPerformed(evt);
            }
        });
        getContentPane().add(backResultButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 400, -1, -1));

        cancelResultButton.setText("Cancel");
        cancelResultButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelResultButtonActionPerformed(evt);
            }
        });
        getContentPane().add(cancelResultButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(480, 400, -1, -1));

        nextResultButton.setText("Next ");
        nextResultButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nextResultButtonActionPerformed(evt);
            }
        });
        getContentPane().add(nextResultButton, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 400, -1, -1));

        jLabel2.setFont(new java.awt.Font("Arial", 0, 14));
        jLabel2.setForeground(new java.awt.Color(51, 51, 51));
        jLabel2.setText("You have comleted the bandwidth test.");
        getContentPane().add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(250, 140, 280, -1));

        label_image.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/config_4_testresult.jpg"))); // NOI18N
        getContentPane().add(label_image, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 110, 180, 180));

        jPanel1.setBackground(new java.awt.Color(204, 204, 204));
        jPanel1.setPreferredSize(new java.awt.Dimension(600, 65));
        jPanel1.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        label_Logo.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/logo_2.png"))); // NOI18N
        jPanel1.add(label_Logo, new org.netbeans.lib.awtextra.AbsoluteConstraints(520, 10, 55, 55));

        label_result.setFont(new java.awt.Font("Arial", 0, 18));
        label_result.setForeground(new java.awt.Color(51, 51, 255));
        label_result.setText("Result");
        jPanel1.add(label_result, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 10, 500, 30));

        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 580, 80));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void nextResultButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextResultButtonActionPerformed
        // TODO add your handling code here:
         this.dispose();
         this.setVisible(false);
     //      new Config_5_speed(new javax.swing.JFrame(), true).setVisible(true);
      new Config_5_speed(new javax.swing.JFrame(), true,this).setVisible(true);
}//GEN-LAST:event_nextResultButtonActionPerformed

    private void backResultButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backResultButtonActionPerformed
        // TODO add your handling code here:
       // this.dispose();
        this.setVisible(false);
     //   Config_3_backup(new javax.swing.JFrame(), true);
        //Config_3_backup.setVisible(true);
       // new Config_3_backup(new javax.swing.JFrame(), true).setVisible(true);
        configBackup.setVisible(true);
}//GEN-LAST:event_backResultButtonActionPerformed

    private void cancelResultButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelResultButtonActionPerformed
       this.dispose();
    }//GEN-LAST:event_cancelResultButtonActionPerformed

    /**
    * @param args the command line arguments
    */
  /*  public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                Config_4_testresult dialog = new Config_4_testresult(new javax.swing.JFrame(), true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {
                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    } */

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton backResultButton;
    private javax.swing.JButton cancelResultButton;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel label_Logo;
    private javax.swing.JLabel label_image;
    private javax.swing.JLabel label_result;
    private javax.swing.JButton nextResultButton;
    // End of variables declaration//GEN-END:variables

}
